import 'package:flutter/material.dart';

const Color _kDefaultGlowColor = Color(0xFFFFFFFF);

/// 去掉Android中滑动的水波纹效果
class NoScrollBehaviorWidget extends ScrollBehavior {
  @override
  Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) {
    switch (getPlatform(context)) {
      case TargetPlatform.iOS:
      case TargetPlatform.linux:
      case TargetPlatform.macOS:
      case TargetPlatform.windows:
        return child;
      case TargetPlatform.android:
      case TargetPlatform.fuchsia:
        return GlowingOverscrollIndicator(
          axisDirection: details.direction,
          color: _kDefaultGlowColor,
          showTrailing: false,
          showLeading: false,
          child: child,
        );
    }
  }
}
